import java.util.*;

public class Test {
    public static void main(String[] args) {
        List<?> list = null;
        list = new ArrayList<String>();
        list = new ArrayList<Double>();
//        list.add("");
        list.add(null);

        List<String> l1 = new ArrayList<String>();
        List<Integer> l2 = new ArrayList<Integer>();
        l1.add("wyl");
                l2.add(15);
        read(l1);
        read(l2);  }
    static void read(List<?> list){
        for(Object o : list){
            System.out.println(o);
        }
    }

    public static void printCollection3(Collection<? extends Test> coll){
        //Iterator只能用Iterator<?>或Iterator<? extends Person>.why?
        Iterator<?> iterator  = coll.iterator();
        while(iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
    public static void printCollection4(Collection<? super Test> coll){
        Iterator<?> iterator  = coll.iterator();
        while(iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }


}
